#ifndef serial_h_
#define serial_h_

#include "include/AT91SAM7S64.h"


#define	MCK	24000000							// hpw: clockrate used on ARM7-Board


struct Usart_struct {
	int port;
	AT91S_USART * pUSART;
	unsigned int baudrate;
	unsigned int hwhs;
};

typedef struct Usart_struct  *Usart;

Usart usart_init (int port, int baudrate);
int usart_putc(Usart usart, int ch);
int usart_putchar(Usart usart, int ch);
void usart_puts(Usart usart, char *s);
int usart_flush(Usart usart);
int usart_kbhit(Usart usart);
int usart_getc(Usart usart);
int usart_puti(Usart usart,long int i);

#endif
